package com.ruxyeah.design.handler;

import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;

public class Factory {

    private static Map<String, AbstractHandler> strategyMap = new HashMap<String, AbstractHandler>();

    public static AbstractHandler getInvokStrategy(String str){
        return strategyMap.get(str);
    }


    public static void register(String str, AbstractHandler abstractHandler){
        if (StringUtils.isEmpty(str) || null== abstractHandler) {
            return;
        }
        strategyMap.put(str, abstractHandler);
    }

}
